package com.trademark.script.methods;

import com.rsbuddy.script.methods.Camera;
import com.rsbuddy.script.methods.Game;
import com.rsbuddy.script.methods.Mouse;
import com.rsbuddy.script.methods.Skills;
import com.rsbuddy.script.task.Task;
import com.rsbuddy.script.util.Random;

public class Antiban {

	public static void threadedCamera() {
		int number = Random.nextInt(0, 5);
		final int amount = Random.nextInt(0, 360);
		if (number == 0) {
			Camera.setPitch(amount);
			Task.sleep(750, 1200);
			Camera.setCompassAngle(amount);
		}
		if (number == 1) {
			Camera.setPitch(false);
			Task.sleep(300, 900);
			Camera.moveRandomly(Random.nextInt(600, 1000),
					Random.nextInt(1100, 1600));
		}
		if (number == 2) {
			Camera.moveRandomly(number);
			Task.sleep(1000, 1500);
			Camera.moveRandomly(number * Random.nextInt(0, 3),
					number * Random.nextInt(3, 5));
		}
		if (number == 3) {
			Camera.setPitch(true);
			Task.sleep(800, 1000);
			Camera.moveRandomly(amount * number);
		}
		if (number == 4) {
			Camera.setCompassAngle(Random.nextInt(0, 360));
			Task.sleep(500, 750);
			Camera.moveRandomly(number);
		}
	}

	public static void threadedMouse() {
		int number = Random.nextInt(0, 5);
		if (number == 0) {
			Mouse.moveSlightly();
			Task.sleep(1000, 1250);
			Mouse.clickSlightly();
		}
		if (number == 1) {
			Mouse.moveSlightly();
			Task.sleep(500, 650);
			Mouse.moveOffScreen();
		}
		if (number == 2) {
			Mouse.moveRandomly(Random.nextInt(500, 600),
					Random.nextInt(900, 1000));
			Task.sleep(800, 900);
			Mouse.moveOffScreen();
		}
		if (number == 3) {
			Mouse.moveRandomly(600, 1000);
			Task.sleep(600, 750);
			Mouse.moveRandomly(1250, 1500);
		}
		if (number == 4) {
			Mouse.moveSlightly();
			Task.sleep(900, 1300);
			Mouse.moveSlightly();
		}
	}

	public static void threadedSkills() {
		int number = Random.nextInt(0, 5);
		if (number == 0) {
			Skills.hover(Skills.COMPONENT_AGILITY);
			Task.sleep(1200, 1500);
			Skills.hover(Skills.COMPONENT_HERBLORE);
		}
		if (number == 1) {
			Skills.hover(Skills.COMPONENT_MINING);
			Task.sleep(500, 600);
			Skills.hover(Skills.COMPONENT_SMITHING);
		}
		if (number == 2) {
			Skills.hover(Skills.COMPONENT_WOODCUTTING);
			Task.sleep(1000, 1100);
			Skills.hover(Skills.COMPONENT_FIREMAKING);
		}
		if (number == 3) {
			Skills.hover(Skills.COMPONENT_ATTACK);
			Task.sleep(800, 900);
			Skills.hover(Skills.COMPONENT_DEFENSE);
		}
		if (number == 4) {
			Skills.hover(Skills.COMPONENT_CONSTITUTION);
			Task.sleep(500, 1000);
			Skills.hover(Skills.COMPONENT_STRENGTH);
		}
	}

	public static void threadedTabs() {
		int number = Random.nextInt(0, 5);
		if (number == 0) {
			Game.openTab(Game.TAB_MAGIC);
			Task.sleep(1000, 1500);
			Game.openTab(Game.TAB_INVENTORY);
		}
		if (number == 1) {
			Game.openTab(Game.TAB_FRIENDS);
			Task.sleep(500, 750);
			Game.openTab(Game.TAB_CLAN);
			Task.sleep(600, 1000);
			Game.openTab(Game.TAB_INVENTORY);
		}
	}
}
